home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _E1EC35F1D9DC4136A8C47278FDD2BBA5 < prev    next >
Encoding:
Text File  |  2004-01-06  |  928 b   |  31 lines

  1.       #include "../CGVPMacro.csi"
  2.  
  3.       PS20Only
  4.  
  5.       MainInput { uniform sampler2D shadMap0 : register(s0),
  6.                   uniform sampler2D baseMap : register(s1),
  7.                   uniform float4 Ambient,
  8.                   uniform float4 Fading }
  9.       DeclarationsScript
  10.       {
  11.         OUT_T0_T1_T2
  12.         FOUT
  13.       }
  14.       CoreScript
  15.       {
  16.         // load the decal
  17.         float4 decalColor = tex2D(baseMap, IN.Tex1.xy);
  18.         // load the 1 shadow sample
  19.         float4 shadColor0 = tex2Dproj(shadMap0, IN.Tex0.xyzw);
  20.         float shad = shadColor0.r/8 + shadColor0.g;
  21.         float fZ = IN.Tex2.x / IN.Tex2.y;
  22.         shad = shad - fZ;
  23.         float fCompare = step(shad, 0.0);
  24.         fCompare = fCompare * shadColor0.a * Fading.x;
  25.         
  26.         float3 color = decalColor.xyz * Ambient.xyz;
  27.         OUT.Color.xyz = color.xyz;
  28.         OUT.Color.a = fCompare;
  29.       }
  30.       
  31.